package com.atguigu.tingshu.user.config;

import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.core.ReturnedMessage;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

@Log4j2
public class UserAccountCallbackConfig implements RabbitTemplate.ReturnsCallback {
    @Override
    public void returnedMessage(ReturnedMessage returnedMessage) {
       log.error("进入队列失败的消息Id是："+new String(returnedMessage.getMessage().getBody())+
               "交换机是："+returnedMessage.getExchange()+"routingKey是："+
               returnedMessage.getRoutingKey());
    }
}
